package cn.neusoft.baibang.domain;

import com.baomidou.mybatisplus.enums.IdType;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzm
 * @since 2022-12-10
 */
@TableName("t_product")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Product extends Model<Product> {

    public static final Integer ONLINE = 1; // 上架
    public static final Integer OFFLINE = 0; // 下架
    private static final long serialVersionUID = 1L;

    /**
     * 服务id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 服务名称
     */
    private String name;
    /**
     * 服务类型
     */
    @TableField("type_id")
    private Long typeId;
    /**
     * 销售量
     */
    @TableField("sales_olume")
    private Integer salesOlume;
    /**
     * 原价
     */
    @TableField("original_price")
    private BigDecimal originalPrice;
    /**
     * 上架时间
     */
    private Date upperShelf;
    /**
     * 下架时间
     */
    private Date lowerShelf;
    /**
     * 折扣价
     */
    @TableField("discount_price")
    private BigDecimal discountPrice;

    private Integer state;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Product{" +
        ", id=" + id +
        ", name=" + name +
        ", typeId=" + typeId +
        ", salesOlume=" + salesOlume +
        ", originalPrice=" + originalPrice +
        ", upperShelf=" + upperShelf +
        ",  lowerShelf=" +  lowerShelf +
        ", discountPrice=" + discountPrice +
        "}";
    }
}
